package org.jiuling.validation.spring.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import org.jiuling.validation.spring.handle.PhoneNumberValidator;

import java.lang.annotation.*;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.ElementType.TYPE_USE;

/**
 * 手机号校验
 * @author 紫灵
 * @date 2024年07月01日 22时24分21秒
 */
@Documented
@Constraint(validatedBy = PhoneNumberValidator.class)
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RetentionPolicy.RUNTIME)
public @interface PhoneNumber {

    String message() default "手机号格式不正确！";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

}
